package com.lagou.repository;

import com.lagou.pojo.Article;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface ArticleRepository extends JpaRepository<Article, Integer> {

    @Query(value = "select * from t_article",
            countQuery = "select COUNT(*) from t_article", nativeQuery = true)
    Page<Article> getArticles(Pageable pageable);
}
